package com.gwall.zk.controller;

import com.gwall.zk.config.NameConfig;
import com.gwall.zk.config.UserProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(("/config"))
public class ConfigController {

    @Resource
    private UserProperties userProperties;

    @Resource
    private NameConfig nameConfig;

    @GetMapping("/index")
    public Object index() {
        return userProperties;
    }

    @GetMapping("/name")
    public Object name() {
        System.out.println(nameConfig);
        return nameConfig.getName();
    }
}
